package com.lin.sppringbootdemo.util;

import com.lin.sppringbootdemo.domain.ResultData;

public class ResultUtil {

    public static ResultData success(Object o) {
        ResultData resultData = new ResultData();
        resultData.setData(o);
        return resultData;
    }

    public static ResultData success() {
        ResultData resultData = new ResultData();
        return resultData;
    }

    public static ResultData fail(String msg) {
        ResultData resultData = new ResultData();
        resultData.setCode(1);
        resultData.setMsg(msg);
        return resultData;
    }

    public static ResultData fail(Integer code,String msg) {
        ResultData resultData = new ResultData();
        resultData.setCode(code);
        resultData.setMsg(msg);
        return resultData;
    }

}
